import {get, post} from "./common";
import {reactive} from "vue";

function getIp() {
    return get('station/ip', null);
}

function addDevice(form) {
    const data = reactive({
        sno: form.sno,
        uuid: form.uuid,
        ip: form.ip.join('.')
    })
    return post('/station/device/addUpdate', data);
}

function removeDevice(id) {
    const params = reactive({
        stationId: id
    })
    return get('/station/device/delete', params);
}

export {
    getIp,
    addDevice,
    removeDevice
}